\section{Comparison with other solvers}

\label{sec:othersolvers}

In this section, we present the time required by some state of the art solvers
for a quadratic program. These solvers use different algorithms, and hence they
have different performance. The goal of this section is to evaluate
whether the particular implementation of PQP algorithm on a GPU is faster than
what is commercially available, and whether using PQP algorithm for MPC is
reasonable. We compare our implementation of the PQP
algorithm on a GPU and a CPU against QuadProg and IPOPT. 
QuadProg is a popular solver which comes bundled with MATLAB; IPOPT is one of
the fastest solvers available.

In Table~\ref{table:avgSolvers}, we present the average time taken by these
solvers. We observe that the serial implementation of PQP is roughly comparable
to QuadProg. The parallel version of PQP is slightly faster than IPOPT. Thus,
if a GPU is available, using our parallel implementation of PQP on GPU is a
reasonable alternative than IPOPT.

In previous section, we pointed out that the computation time for an individual
run depends on the sparsity of $\lambda$. We also present these results: the
minimum and the maximum time required for our implementation and the other
solvers. We can see that QuadProg is definitely slower. However, the performance
of our
implementation is more variable than IPOPT. Even though the average time
required for our GPU implementation is less than IPOPT, the longest run of our
algorithm is more than twice the time taken by IPOPT. Thus, IPOPT seems to be
more resilient to the variation in time due to sparsity of lambda. 

\begin{table}
\begin{center}
\begin{tabular}{|l|l|l|l|}
\hline
Program & Average Time & Min Time & Max Time \\
\hline
MATLAB QuadProg & 5.0169 s & 4.2009 s &11.5640 s \\
IPOPT via YALMIP & 1.2866 s & 0.6946 s &  1.3138 s \\
Serial PQP on CPU & 6.1895 s & 1.1751 s & 7.5312 s \\ 
Parallel PQP on GPU & 1.1881 s & 0.3964 s & 2.8209 s \\
\hline
\end{tabular}
\caption{Time for Different Solvers over 100 Time Steps}
\label{table:avgSolvers}
\end{center}
\end{table}

